(function(angular) {
	"use strict";
	angular.module("fs.waf").controller("cls.popup.settlement.summary.loanMoreDataController", loanMoreDataController);
	loanMoreDataController.$inject = [ "$scope", "$uibModalInstance", "dialogsModule", "gridService", "layoutConfig", "validatorConfig" ];
	function loanMoreDataController($scope, $uibModalInstance, dialogsModule, gridService, layoutConfig, validatorConfig) {
		var ctrl = this;
		ctrl.dialogsModule = dialogsModule;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;

		ctrl.ok = function() {
			if (!dialogsModule.btnCallback || !dialogsModule.btnCallback["ok"] || dialogsModule.btnCallback["ok"]() !== false) {
				$uibModalInstance.close();
			}
		};

		ctrl.close = function() {
			if (!dialogsModule.btnCallback || !dialogsModule.btnCallback["close"] || dialogsModule.btnCallback["close"]() !== false) {
				$uibModalInstance.dismiss();
			}
		};

		ctrl.init = function() {
			ctrl.moreDataList = [];
			if (ctrl.dialogsModule.params) {
				ctrl.moreDataList = ctrl.dialogsModule.params;
			}
			ctrl.innerGridOptions = gridService.createInnerGridOptions($scope, ctrl.layoutConfig.formConfigs.moreDataList.tableConfigs.table, angular.noop);
			ctrl.innerGridOptions.data = "vm.moreDataList";
		};
	}
})(angular);
